package com.cn.ycy.controller;

import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/log")
public class LogController {

  static final Logger LOGGER = LoggerFactory.getLogger(LogController.class);

  @GetMapping("/create")
  public HashMap<Object, Object> dolog(String id) {
    LOGGER.info("hello word {}", 1);
    LOGGER.error("hello word {}", 1);
    LOGGER.warn("hello word {}", 1);
    LOGGER.debug("hello word {}", 1);

    try {
//      int i = Integer.parseInt(id);
    } catch (Exception e) {
//      LOGGER.error("{}", e.getMessage(), e);
    }

    HashMap<Object, Object> objectObjectHashMap = Maps.newHashMap();
    objectObjectHashMap.put("1", "2");
    return objectObjectHashMap;
  }

}
